﻿using System.Collections.Generic;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Localization;
using Volo.Abp.MultiTenancy;
using Volo.Abp.SettingManagement;
using Volo.Abp.Settings;
using Volo.Abp.Users;

namespace SanJ.FreeCare.Notifications
{
    public class NotificationSettingManagementProvider : SettingManagementProvider, ITransientDependency
    {
        public override string Name => TenantSettingValueProvider.ProviderName;

        protected ICurrentTenant CurrentTenant { get; }
        protected ICurrentUser CurrentUser { get; }

        public NotificationSettingManagementProvider(
            ISettingManagementStore settingManagementStore,
            ICurrentTenant currentTenant,
            ICurrentUser currentUser)
            : base(settingManagementStore)
        {
            CurrentTenant = currentTenant;
            CurrentUser = currentUser;
        }

        protected override string NormalizeProviderKey(string providerKey)
        {
            if (providerKey != null)
            {
                return providerKey;
            }

            return CurrentTenant.Id?.ToString();
        }

        //public override void Define(ISettingDefinitionContext context)
        //{
        //    context.Add(
        //        new SettingDefinition(NotificationSettingNames.ReceiveNotifications,
        //            "true",
        //            L("ReceiveNotifications"),
        //            L("Description:Abp.Localization.DefaultLanguage"),
        //            isVisibleToClients: true)
        //    );
        //}



        //private static LocalizableString L(string name)
        //{
        //    return new LocalizableString(name, HopeConsts.LocalizationSourceName);
        //}
    }
}
